﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<base href="<%=basePath%>">
<!-- 下拉框 -->
<link rel="stylesheet" href="static/ace/css/chosen.css" />
<!-- jsp文件头和头部 -->
<%@ include file="../../system/index/top.jsp"%>
<!-- 日期框 -->
<link rel="stylesheet" href="static/ace/css/datepicker.css" />
</head>
<body class="no-skin">

	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">
		<!-- /section:basics/sidebar -->
		<div class="main-content">
			<div class="main-content-inner">
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<!-- 检索  -->
							<form action="areagoodscount/goodsSpecList" method="post"
								name="goodsSpecForm" id="goodsSpecForm">
								<%-- <input type="text" id="checId" name="checId"  value="${pd.checkId }"/> --%>
								<table style="margin-top: 5px;">
									<tr>
										<td>
											<div class="nav-search">
												<span class="input-icon"> <input
													
													id="nav-search-input" type="text" name="goodName"
													value="${pd.goodName }" placeholder="这里输入商品名称" /> <i
													class="ace-icon fa fa-search nav-search-icon"></i>
													<input type="hidden" id="seId" name="seId"  value="${pd.seId }"/>
												</span>
											</div>
										</td>
										<c:if test="${QX.cha == 1 }">
											<td style="vertical-align: top; padding-left: 2px;"><a
												class="btn btn-light btn-xs" onclick="searchs();" title="检索"><i
													id="nav-search-icon"
													class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td>
										</c:if>
									</tr>
								</table>

								<!-- 检索  -->
								<table id="simple-table"
									class="table table-striped table-bordered table-hover"
									style="margin-top: 5px;">
									<thead>
										<tr>
											<th class="center" style="width:50px;">选中</th>
											<th class="center">ID</th>
											<th class="center">编号</th>
											<th class="center">商品ID</th>
											<th class="center">商品名称</th>
											<th class="center">规格</th>
											<!-- <th class="center">图片</th> -->
											<th class="center"><i
												class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>创建时间</th>
											<th class="center">创建人</th>
											<th class="center"><i
												class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>更新时间</th>
											<th class="center">修改人</th>
										</tr>
									</thead>
									<tbody>

										<!-- 开始循环 -->
										<c:choose>
											<c:when test="${not empty goodsSpecList}">
												<c:if test="${QX.cha == 1 }">
													<c:forEach items="${goodsSpecList}" var="goodsSpec"
														varStatus="vs">
														<tr>
															<td class='center' style="width: 30px;">
															<input type='radio'  id='goodsId' name='goodsId' value="${goodsSpec.id }" goodsName="${goodsSpec.goodName}" class="lbl"> </td>
															<td class='center' style="width: 30px;">${goodsSpec.id}</td>
															<td class="center">${goodsSpec.code }</td>
															<td class="center">${goodsSpec.goodsId }</td>
															<td class="center">${goodsSpec.goodName }</td>
															<td class="center">${goodsSpec.spec }</td>
															<td class="center">${goodsSpec.createTime }</td>
															<td class="center">${goodsSpec.createId }</td>
															<td class="center">${goodsSpec.updateTime }</td>
															<td class="center">${goodsSpec.updateId }</td>
														</tr>
													</c:forEach>
												</c:if>
												<c:if test="${QX.cha == 0 }">
													<tr>
														<td colspan="100" class="center">您无权查看</td>
													</tr>
												</c:if>
											</c:when>
											<c:otherwise>
												<tr class="main_info">
													<td colspan="100" class="center">没有相关数据</td>
												</tr>
											</c:otherwise>
										</c:choose>
										<input type="hidden" id="ids" name="ids" value=""/>
										<input type="hidden" id="title" name="title" value=""/>
									</tbody>
								</table>
								<div class="page-header position-relative">
									<table style="width: 100%;">
										<tr>
											<td style="vertical-align: top;">
												<div class="pagination"
													style="float: right; padding-top: 0px; margin-top: 0px;">${page.pageStr}</div>
											</td>
										</tr>
									</table>
								</div>
							</form>
						</div>
						<!-- /.col -->
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->
		<!-- 返回顶部 -->
		<a href="#" id="btn-scroll-up"
			class="btn-scroll-up btn btn-sm btn-inverse"> <i
			class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
		</a>
	</div>
	<!-- /.main-container -->
	<!-- basic scripts -->
	<!-- 页面底部js¨ -->
	<%@ include file="../../system/index/foot.jsp"%>
	<!-- 删除时确认窗口 -->
	<script src="static/ace/js/bootbox.js"></script>
	<!-- ace scripts -->
	<script src="static/ace/js/ace/ace.js"></script>
	<!-- 日期框 -->
	<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
	<!-- 下拉框 -->
	<script src="static/ace/js/chosen.jquery.js"></script>
	<!--提示框-->
	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
</body>
<script type="text/javascript">
		$(top.hangge());
		$(function() {
			$(":radio").on("change",function(){
				var id = $(this).val();
				var goodName = $(this).attr("goodsName");
				$("#ids").val(id);
				$("#title").val(goodName);
			});
			var goodsSpecId=$.trim($("#seId").val());
			
			if(goodsSpecId.length>0){
				var allElement=$(":radio");
				for(var i=0;i<allElement.length;i++){
					if(allElement.eq(i).val()==goodsSpecId){
						allElement.eq(i).attr('checked', 'true');
						var id = allElement.eq(i).val();
						var goodName = allElement.eq(i).attr("goodsName");
						$("#ids").val(id);
						$("#title").val(goodName);
						break;
					}
				}
			}
			
			
		});
		
		
		//检索
		function searchs(){
			top.jzts();
			$("#goodsSpecForm").submit();
		}
	
</script>
</html>
